package com.angel.bo.admin.controller;

import com.angel.bo.admin.service.RoleService;
import com.angel.bo.admin.service.UserRoleService;
import com.angel.bo.beans.admin.entity.Role;
import com.angel.bo.beans.admin.vo.UserRoleVo;
import com.angel.bo.common.controller.BaseController;
import com.angel.bo.common.msg.WebReturn;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 
 *
 * @author ${author}
 * @email haibo.mei@ge.com
 * @date 2018-02-01 14:32:20
 */
@RestController
@RequestMapping("role")
@Api(value = "OrganizationController",description = "角色管理",tags = "角色管理")
public class RoleController extends BaseController<RoleService,Role> {

    @Autowired
    private UserRoleService userRoleService;

    @RequestMapping(value = "/configUserRole", method = RequestMethod.POST)
    @ApiOperation(value = "给用户授权角色")
    public WebReturn  configUserRole(@RequestBody UserRoleVo userRoleVo){
        return userRoleService.configUserRole(userRoleVo);
    }


    @RequestMapping(value = "/getUserRoleList", method = RequestMethod.POST)
    @ApiOperation(value = "获取用户授权角色")
    public WebReturn getUserRoleList(@RequestBody UserRoleVo userRoleVo){
        return userRoleService.getUserRoleList(userRoleVo);
    }
}